﻿#ifndef WEMEET_WMP_MEETING_VIDEO_FRAME_H_
#define WEMEET_WMP_MEETING_VIDEO_FRAME_H_

#include "meeting_video_frame_interface.h"
#include "video_device.h"
#include "video_stream.h"

class MeetingVideoFrameController
  : public IMeetingVideoFrameController
  , public Device::Video::Listener::Interface
  , public Stream::Video::Listener::Interface {
public:

  MeetingVideoFrameController();

  virtual ~MeetingVideoFrameController();

  virtual int SetDelegate(IMeetingVideoFrameCtrlDelegate* delegate);

  //Device::Video::Listener::Interface
  virtual void OnAddCamera(const char* device_id, bool add);

  virtual void OnCameraPreview(const char* device_id, uint8_t* data, uint32_t data_size, uint32_t format, uint32_t width, uint32_t height);
    
  virtual void OnCameraUpdate(const char* device_id, int state){}

  //Stream::Video::Listener::Interface
  virtual void OnUpVideoStream(const char* stream_id, bool add) {}

  virtual void OnDownVideoStream(const char* stream_id, uint64_t uin, bool add) {}
  
  virtual void OnVideoStreamUpdate(const char* stream_id, uint64_t uin, int state){}

  virtual void OnVideoStreamFrame(
    uint64_t uin, uint8_t* data, uint32_t data_size, int32_t format, uint32_t width, uint32_t height, uint32_t rotate, const char* stream);
    
private:
  IMeetingVideoFrameCtrlDelegate* delegate_;
};

#endif  // WEMEET_WMP_MEETING_VIDEO_H_
